package com.huanghuai.retail.controller;

import com.huanghuai.retail.common.R;
import com.huanghuai.retail.dto.CargoDto;
import com.huanghuai.retail.entity.CargoLanes;
import com.huanghuai.retail.entity.PInformation;
import com.huanghuai.retail.service.CargoLanesService;
import com.huanghuai.retail.service.DeviceService;
import com.huanghuai.retail.service.InformationService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
@RestController
@RequestMapping("/cargo")
public class CargoLanesController {
    @Resource
    private CargoLanesService cargoLanesService;


    @Transactional
    @GetMapping("/update")
    public R<String> setCargo(@RequestBody CargoDto cargoDto) {
        return cargoLanesService.setCargo(cargoDto);
    }

    @Transactional
    @GetMapping("/{id}")
    public R<CargoDto> getCargoById(@PathVariable("id") Long id) {
        return cargoLanesService.getCargoById(id);
    }
}
